def get_breadcrumb(category):
    """
    获取面包屑导航
    :param category: 1级 2级 3级
    :return: 面包屑导航字典列表
    """
    breadcrumb = {
        'cat1': "",
        'cat2': "",
        'cat3': ""
    }
    if category.parent is None:
        # 1级分类
        breadcrumb['cat1'] = category
    elif category.parent.parent is None:
        # 2级分类:
        breadcrumb['cat1'] = category.parent
        breadcrumb['cat2'] = category
    else:
        # 3级分类
        breadcrumb['cat1'] = category.parent.parent
        breadcrumb['cat2'] = category.parent
        breadcrumb['cat3'] = category
    return breadcrumb

